package com.song.invoicing.controller;

import com.song.invoicing.pojo.Result;

import com.song.invoicing.pojo.dto.SaleQueryDTO;
import com.song.invoicing.service.SaleRecordService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/sale_record")
@RequiredArgsConstructor
public class SaleRecordController {

     private final SaleRecordService saleRecordService;
    @GetMapping("/getSaleRecords")
    public Result<Map<String, Object>> getSaleRecords(SaleQueryDTO saleQueryDTO) {
        return Result.success(saleRecordService.getSaleRecords(saleQueryDTO));
    }
}
